All Functions Used on PO11Q

desc

{dplyr}

Arrange in descending order

hist

{graphics}

Plot a simple histogram

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

theme

{GGPLOT2}

Set theme for GGPLOT2

set.seed

{base}

Initialise a pseudorandom number generator.

dnorm

{stats}

Density distribution for the normal distribution

separate

{dplyr}

Separate a character column into multiple columns

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

min

{base}

Get minimum of a vector

ifelse

{base}

Return a or b depending on the value of test

summary

{base}

Obtain summary statistics or detailed regression output

spread

{tidyr}

Spread a key-value pair across multiple columns

complete.cases

{stats}

Find Complete Cases

factor

{base}

Create a factor

n

{dplyr}

The number of observations in the current group.

rnorm

{base}

Generate random numbers from a normal distribution

sum

{base}

Get sum of numeric values or a vector

median

{stats}

Get median of a vector

filter

{dplyr}

Filter out rows of a data frame according to logical vector

save

{base}

Writes an external representation of R objects to the specified file.

labs

{GGPLOT2}

Customise labels in GGPLOT2

data.frame

{base}

Create a data.frame from vectors

slice

{dplyr}

Subset rows using their positions

as.character

{base}

Coerce a vector to character

setwd

{base}

Set Working Directory

which.max

{base}

return index of the largest value in a vector

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

length

{base}

Returns number of elements in an object

tibble

{tibble}

A modern data frame from the tidyverse

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

read_excel

{readxl}

Read an Excel file

stat_ecdf

{GGPLOT2}

Compute empirical cumulative distribution

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

geom_line

{GGPLOT2}

Generates a line

seq

{base}

Create a sequence

install.packages

{base}

Install R package

boxplot

{graphics}

Plot a simple box plot

View

{base}

View a data frame

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

read_dta

{haven}

Read a .dta file (Stata data)

geom_segment

{GGPLOT2}

Generates a line segment or curve

nrow

{base}

Get number of rows of a data frame

plot

{graphics}

Generic function from base R to produce a plot

recode

{dplyr}

Recode a variable

element_text

{GGPLOT2}

Customise text in GGPLOT2

print

{base}

Print object to the console

c

{base}

Combine values/vectors into a vector

rm

{base}

Remove objects

geom_histogram

{GGPLOT2}

Generates a histogram

colnames

{base}

Retrieve column names of a data frame

cut

{base}

Convert Numeric to Factor

with

{base}

evaluate expression in the context of a data frame

mutate

{dplyr}

Modify/create a column in a data frame

ggplot

{GGPLOT2}

Create a ggplot graph

element_blank

{GGPLOT2}

This theme element draws nothing, and assigns no space

is.na

{base}

Check if a value is NA/elements of vector are NA

str

{utils}

Get the structure of an R object

element_line

{GGPLOT2}

Customise line appearance

as.numeric

{base}

Coerce a vector to numeric

library

{base}

Load an R package

expression

{base}

Used in plots to add symbols to axes

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

sqrt

{stats}

Square root

select

{dplyr}

Select columns from a tibble/data frame

ungroup

{dplyr}

Resolve grouping created with “group_by”

geom_ribbon

{GGPLOT2}

Generates an area plot

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

quantile

{stats}

Obtain empirical quantiles of a vector

names

{base}

Retrieve names of a list/vector

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

max

{base}

Get maximum of a vector

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

sd

{stats}

Get standard deviation of a vector

range

{base}

Return range of values

write.csv

{utils}

write a csv file to a data frame

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

geom_density

{GGPLOT2}

Generates a density plot

mean

{base}

Get mean of a vector

prop.test

{stats}

Test of Equal or Given Proportions

levels

{base}

Get levels of a factor

var

{stats}

Calculate variance

head

{utils}

Show first 5 rows of a data frame

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

par

{graphics}

Set parameters of the plotting device

ordered

{dplyr}

Create an ordered factor

The end!